<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("class_id")->comment("类型ID");
            $table->string("class_name")->comment("类型名称");
            $table->string("goods_name")->comment("商品名称");
            $table->string("image",150)->comment("商品图片");
            $table->decimal("price",10,2)->default(0)->comment("价格");
            $table->integer("integral")->default(0)->comment("积分");
            $table->text("detail")->nullable()->comment("详情图片");
            $table->integer("read_num")->default(0)->comment("阅读量");
            $table->integer("sell_num")->default(0)->comment("销量");
            $table->integer("status")->default(1)->comment("状态");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
